<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="root"></div>
  <script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
  <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
  <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
  <script type="text/babel">
    // React HookAPI  
    // 函数 式组件 useState 创建数据和修改数据的方法'
    function Cart() {
      let [msg, setMsg] = useState("你好")
      let kk = "周末休息";
      let mychange = function () {
        setMsg('你好不好')
      }
      return (
        <div>
          <h1>{kk}</h1>
          <h1 onClick={() => setMsg('你不好')}>{msg}</h1>
        </div >
      )
    }
    ReactDOM.render(<Cart />, document.getElementById("root"))
  </script>
</body>

</html>